<template>
	<view class="container">
		<view class="cont_box">
			<view class="video">
				<view class="title">
					上传视频素材
				</view>
				<view class="desc">
					最大显示99MB
				</view>
				<!-- 上传视频 -->
				<view class="upload">
					<view class="iconfont icon-shangchuan">

					</view>
					<view class="upload_title">
						点击视频上传至此处
					</view>
					<view class="upload_but">
						选择视频
					</view>
				</view>
				<!-- 视频展示 -->
				<view class="">

				</view>
			</view>
			<view class="timbre">
				<view class="timbre_title">
					<view class="title">
						选择音色
					</view>
					<view class="subsection">
						<u-subsection inactiveColor='#6c7b91' activeColor='#6c7b91' :list="timbrelist"
							:current="timbrevalue" @change="timbreChange"></u-subsection>
					</view>
				</view>
				<!--系统音色 -->
				<view class="system_tone" v-if="timbrevalue==0">
					<view class="system_tone_item" :class="activesystem==index? 'system_tone_item_active':''"
						v-for="(item,index) in systemlist" :key="index" @click='activesystemfn(index)'>
						<view class="system_tone_item_">
							<view class="system_tone_item_title">
								{{item.name}}
							</view>
							<view class="">
								<span v-if="activesystem==index" class="iconfont icon-duihao2"></span>
								<span v-else class="iconfont icon-weixuanzhongyuanquan"></span>
							</view>
						</view>
						<view class="desc">
							{{item.desc}}
						</view>
					</view>
				</view>
				<!-- 上传音色 -->
				<view class="upload" v-else>
					<view class="iconfont icon-shangchuan">

					</view>
					<view class="upload_title">
						点击音频上传至此处
					</view>
					<view class="upload_but">
						选择视频
					</view>
				</view>
			</view>
			<view class="timbre text">
				<view class="timbre_title">
					<view class="title">
						文本输入
					</view>
					<view class="subsection">
						<u-subsection inactiveColor='#6c7b91' activeColor='#6c7b91' :list="textlist"
							:current="textvalue" @change="textChange"></u-subsection>
					</view>
				</view>
				<view class="desc" v-if="textvalue==0">
					请输入需要转换为语音的文本
				</view>
				<!--自定义文本 -->
				<view class="" v-if="textvalue==0">
					<u--textarea v-model="value2" border='surround' height='100' placeholder="请输入内容"
						count></u--textarea>
				</view>
				<!-- AI生成 -->
				<view class="" v-else>
					<view class="ai_chat">
						<scroll-view scroll-y="true" class="scroll-Y scroll_list" @scrolltolower="lower"
							:style="{ height: 'calc(400px)' }">
							<view class="list_item">
								<!-- 问题和头像，头像在右边 -->
								<view class="question">

									<view class="text">
										erwew
									</view>
									<view class="avatar-right iconfont icon-wode1">

									</view>
								</view>

								<!-- 回答和头像，头像在左边 -->
								<view class="answer">
									<view class="avatar-left iconfont icon-jiqiren">
										<!-- <image class="avatar" src="answer-avatar.jpg" /> -->
									</view>
									<view class="text">
										<p>这里是回答内容</p>
									</view>
								</view>
							</view>

						</scroll-view>
					</view>
					<view class="ai_item">
						<view class="item_input">
							<u--textarea v-model="value2" autoHeight placeholder="请输入内容"></u--textarea>
						</view>
						<view class="itme_but">
							发送
						</view>
					</view>
				</view>
			</view>
			<view class="timbre footer">
				<view class="prompt">
					<view class="iconfont  icon-shibai-xianxing">

					</view>
					<view class="prompt_detail">
						<view class="prompt_title">
							视频生成信息
						</view>
						<view class="prompt_time desc">
							预计生成时间 5 分钟
						</view>
						<view class="desc">
							当前队列3个任务，您的任务排在第39位
						</view>
					</view>
				</view>
				<view class="but">
					<view class="cancel _but">
						取消
					</view>
					<view class="submit _but">
						确认
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				timbrelist: ['系统音色', '自定义音色'],
				textlist: ['手动输入', 'AI生成'],
				systemlist: [{
						name: '标准女生',
						desc: '清晰自然，适合大多数场景'
					},
					{
						name: '沉稳男生',
						desc: '成熟稳重适合故事讲述'
					},
					{
						name: '甜美童声',
						desc: '活泼可爱，适合儿童内容'
					},
					{
						name: '情感主播',
						desc: '富有感染力，适合故事讲述'
					},

				],
				activesystem: 0,
				timbrevalue: 0,
				textvalue: 1,
				value2: ''
			};
		},
		components: {},
		onload() {

		},
		mounted() {

		},
		watch: {

		},
		methods: {
			timbreChange(index) {
				this.timbrevalue = index
			},
			textChange(index) {
				this.textvalue = index
			},
			activesystemfn(e) {
				this.activesystem = e
			},
			lower() {

			}
		}
	};
</script>

<style scoped lang="scss">
	::v-deep .u-subsection {
		background-color: #d1d5db !important;
		padding: 5px 10px !important;
		width: 100% !important;
		border-radius: 30px !important;
	}

	::v-deep .u-subsection--button {
		height: 40px !important;
	}

	::v-deep .u-subsection__bar {
		height: 30px !important;
		border-radius: 30px !important;
		// width: 167px !important;
	}

	.container {
		padding: 15px;
		height: calc(100vh - 30px);
		overflow: auto;
		background-color: #f9fafb;

		.title {
			font-size: 32rpx;
			font-weight: 600;
		}

		.desc {
			font-size: 24rpx;
			color: #738093;
			margin: 10px 0;
		}

		.cont_box {
			.video {
				background-color: #fff;
				padding: 15px;
				border-radius: 10px;
				margin-bottom: 10px;

			}

			.upload {
				margin: 10px 0;
				border: 1px solid #bababa;
				border-radius: 10px;
				padding: 20px;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.icon-shangchuan {
					color: #797979;
					font-size: 50rpx;
				}

				.upload_title {
					font-size: 28rpx;
					font-weight: 600;
					margin: 10px 0;
				}

				.upload_but {
					height: 35px;
					width: 90px;
					background-color: #f97316;
					line-height: 35px;
					text-align: center;
					color: #fff;
					font-size: 28rpx;
					font-weight: 600;
					border-radius: 30px;
				}
			}

			.timbre {
				background-color: #fff;
				padding: 15px;
				border-radius: 10px;

				.timbre_title {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.subsection {
						width: 50%;
					}
				}

				.system_tone {
					display: flex;
					flex-wrap: wrap;
					justify-content: space-between;

					.system_tone_item {
						width: calc(50% - 30px);
						padding: 10px;
						border: 1px solid #bababa;
						border-radius: 10px;
						margin-top: 10px;

						.system_tone_item_ {
							display: flex;
							justify-content: space-between;

							.system_tone_item_title {
								font-size: 30rpx;
								font-weight: 600;
							}

							.iconfont {
								font-size: 44rpx;
							}

							.icon-weixuanzhongyuanquan {
								color: #738093;
							}

							.icon-duihao2 {
								color: #f97316;
							}
						}
					}

					.system_tone_item_active {
						border: 2px solid #f97316;
					}
				}
			}

			.text {
				margin-top: 10px;

				::v-deep .u-textarea {
					border: 1px solid #cacaca;
					margin: 10px 0;
				}

				.ai_chat {
					background-color: #f9fafb;
					margin: 10px 0;
					border-radius: 5px;

					.scroll-list {
						display: flex;
						flex-direction: column-reverse;
						/* 逆序显示聊天记录 */
					}

					.list_item {
						display: flex;
						flex-direction: column;
						padding: 10px;
					}

					.question,
					.answer {
						display: flex;
						// align-items: center;
						// margin-bottom: 10px;
					}

					.question {
						justify-content: flex-end;
					}

					.avatar-right,
					.avatar-left {
						margin-top: 10px;
						width: 40px;
						height: 40px;
						// border-radius: 50%;
						// background-color: #000;
					}

					.iconfont {
						text-align: center;
						font-size: 40rpx;
						font-weight: 600;
						line-height: 40px;
						color: #fff;
						border-radius: 10px;
					}

					.avatar-right {
						background-color: #00c8c8;

						margin-left: 10px;
						// margin-left: auto;
						/* 将问题的头像推到右边 */
					}

					.avatar-left {
						margin-right: 10px;
						font-weight: 500;
						background-color: #00aa7f;
						// margin-right: auto;
						/* 将回答的头像推到左边 */
					}

					.text {
						max-width: 70%;
						padding: 10px;
						background-color: #fff;
						border-radius: 10px;
					}
				}

				.ai_item {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.item_input {
						width: calc(100% - 70px);
					}

					.itme_but {
						height: 40px;
						width: 60px;
						line-height: 40px;
						text-align: center;
						border-radius: 10px;
						color: #fff;
						background-color: #f97316;
					}
				}

			}

			.footer {
				margin-top: 10px;
			}

			.prompt {
				display: flex;
				background-color: #fff7ed;
				padding: 10px 15px 5px;
				margin-top: 10px;
				border-radius: 10px;
.icon-shibai-xianxing{
	color: #f97316;
	font-size:30rpx;
	margin-top: 3px;
	margin-right: 5px;
}
				.prompt_title {
					font-size: 28rpx;
					font-weight: 600;
				}

			}

			.but {
				display: flex;
				justify-content: space-around;
				margin-top: 20px;

				._but {
					width: 40%;
					height: 40px;

					line-height: 40px;
					text-align: center;
					border-radius: 30px;
				}

				.cancel {
					border: 1px solid #8d8d8d;
					color: #000;
				}

				.submit {

					background-color: #f97316;
					color: #fff;
				}
			}

		}

	}
</style>